<%@include file="menu/util.jsp" %>
<%@page contentType="text/html; charset=iso-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <fmt:bundle basename="app">
        <head>

            <%@include file="menu/wizardTablessHeader.jsp" %>


            <script type="text/javascript">
                /* $.validator.setDefaults({
                    submitHandler: function() {
                       
                        var nom = $('#name').attr('value');
                        var desc = $('#description').attr('value');
                        var id = $('#frameId').attr('value');
                        var cbFramework = $('#cbFramework').attr('value');

                        if(id >= 0){
                            editFramework(id,nom,desc,cbFramework);
                        }else{
                            insertFramework(nom,desc);
                        }
                    }
                });

                $().ready(function() {
                    // validate the comment form when it is submitted
                    $("#newFramework").validate({
                        errorLabelContainer: $(".errorDiv"),
                        wrapper: "li"
                    });
                });*/
            </script>


            <c:set var="name" value=""/>
            <c:set var="description" value=""/>
            <c:set var="active" value="false"/>
            <c:set var="id" value="-1"/>
            <c:set var="selectedValue"  value="OFF"/>

            <c:if test="${frameworkEdit != null}" >
                <c:set var="name" value="${frameworkEdit.name}"/>
                <c:set var="description" value="${frameworkEdit.description}"/>
                <c:set var="active" value="${frameworkEdit.active}"/>
                <c:set var="id" value="${frameworkEdit.idFramework}"/>
            </c:if>

            <c:if test="${frameworkEdit.active}">
                <c:set var="selectedValue"  value="ON"/>
            </c:if>

        </head>

        <body style="overflow:hidden;" >

            <form id="newFramework" action="newFramework.do" enctype="multipart/form-data" method="post">
                <div class="wizard" style="width:620px; height: 304px;">
                    <h1><c:choose>
                            <c:when test="${id != null}">
                                Editar Framework
                            </c:when>
                            <c:otherwise>
                                Crear Framework
                            </c:otherwise>
                    </c:choose></h1>
                    <div id="TabbedPanels1" class="TabbedPanels" style="width: 620px;">
                        <div class="TablessPanels">
                            <div class="TablessPanelContent" style="overflow:hidden;">
                                <div class="floatLeft boxWizard">
                                    <table>
                                        <tr>
                                            <td>
                                                <fmt:message key="forms.name" />
                                            </td>
                                            <td>
                                                <input class="required" title="<fmt:message key="error.framework.name"/>" type="text" id="name" name="name" value="${name}" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <fmt:message key="forms.description" />
                                            </td>
                                            <td>
                                                <input id="description" type="text" title="<fmt:message key="error.framework.description"/>" name="description" value="${description}" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Logo
                                            </td>
                                            <td>
                                                <input id="logo" type="file" title="<fmt:message key="error.framework.description"/>" name="logo" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <fmt:message key="forms.selected" />
                                            </td>
                                            <td>
                                                <input type="checkbox" name="cbFramework" id="cbFramework"
                                                       <c:if test="${frameworkEdit.active}">
                                                           checked
                                                       </c:if>
                                                       />
                                            </td>
                                        </tr>

                                        <tr>
                                            <td colspan="2">
                                                <div class="errorDiv"></div>
                                            </td>
                                        </tr>

                                    </table>
                                    <input type="hidden" id="frameId" name="id" value="${id}" />
                                </div>
                                <div  class="floatLeft boxWizard">
                                </div>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <div class="botonesWizard">
                        <input  name="send" type="submit" id="send" class="buttonTabbedBox" value="<fmt:message key='forms.send'/>" />
                        <input name="Reset" type="reset" class="buttonCancelTabbedBox" value="<fmt:message key='forms.cancel'/>" />
                    </div>
                    <div class="clear"></div>
                    <script type="text/javascript">
                        var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
                    </script>
                </div>
            </form>

        </body>
    </fmt:bundle>
</html>

